import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2023-08-20
 * Time: 19:59
 */
public class TEST1 {
    public static void main(String[] args) {
        List<Integer> list1=new ArrayList<>();
        ArrayList<Integer> list3=new ArrayList<>();


        List<Integer> list2=new ArrayList<>(10);
        // list4构造好之后，与list中的元素一致
        ArrayList<Integer> list4=new ArrayList<>(list2);
        list2.add(1);
        list2.add(2);
        list2.add(3);
        //list2.add("hell");
        System.out.println(list2.toString());

    }
}


class Test23{
    public static void main(String[] args) {
        List<String> list1=new ArrayList<>();
        list1.add("hello");
        list1.add("world");
        list1.add("bit");
        System.out.println(list1);
        System.out.println(list1.toString());

        for (int i = 0; i <list1.size(); i++) {
            System.out.print(list1.get(i)+" ");
        }
        System.out.println();
        for (String x: list1) {
            System.out.print(x+" ");
        }
        System.out.println();

        Iterator<String> it=list1.listIterator();
        while(it.hasNext()){
            System.out.print(it.next()+" ");
        }
    }
}

class  Test34{
    public static void func(String str1,String str2){
        List<Character> list1=new ArrayList<>();
        for (int i = 0; i <str1.length(); i++) {
            char ch=str1.charAt(i);
            if(!str2.contains(ch+"")){
                list1.add(ch);
            }
        }
        for (int i = 0; i <list1.size(); i++) {
            System.out.print(list1.get(i));
        }
    }
    public static void main(String[] args) {
        func("hello welcome","wel");
    }
}


class  Test45{
    public static List<List<Integer>> generateqw(int numRows){
        List<List<Integer>> ret=new ArrayList<>();
        List<Integer> list=new ArrayList<>();

        list.add(1);
        System.out.print(list+" ");
        System.out.println();
        ret.add(list);

        for (int i = 1; i <numRows; i++) {
            List<Integer> curRow=new ArrayList<>();
            curRow.add(1);
            List<Integer> preRow=ret.get(i-1);
            for (int j = 1; j <i; j++) {
                int val=preRow.get(j)+preRow.get(j-1);
                curRow.add(val);
            }
            curRow.add(1);
            System.out.print(curRow+" ");
            ret.add(curRow);
            System.out.println();
        }
        return ret;
    }

    public static void main(String[] args) {
        List<List<Integer>> RET=new ArrayList<>();
        RET=generateqw(5);
        System.out.println(RET);
    }
}